package net.java.mediasystems.database.core.repository.jpa;

import java.util.List;

import net.java.mediasystems.database.core.model.Metadata;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface MetadataRepository extends JpaRepository<Metadata, Long> {
	
	/**
	 * Find all Metadata by the given Category Name.
	 * 
	 * @param category String
	 * @return List<Metadata>
	 */
	List<Metadata> findAllByCategory(String category);
	
	/**
	 * find a Metadata by its Category (case-sensitive) and name (not case-sensitive).
	 * 
	 * @param category String
	 * @param name String
	 * @return Metadata
	 */
	Metadata findByCategoryAndNameIgnoreCase(String category, String name);
}
